package com.example.controller;

import com.example.domain.DepartmentRepository;
//import com.spring4all.swagger.EnableSwagger2Doc;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

//@EnableSwagger2Doc // 开启 Swagger
@RestController
@RequestMapping("/user")
@Api("swaggerDemoController相关的api")
public class UserController {
    @Autowired
    DepartmentRepository departmentRepository;

    @ApiOperation(value = "用户列表",notes = "用户列表")
    @RequestMapping(value = "/findAll",method = RequestMethod.GET)
    public String getUserList(){
        return departmentRepository.findAll().listIterator().toString();
    }


    @RequestMapping("/")
    String home(){
        return "hello";
    }
}
